<?php if (!defined('THINK_PATH')) exit();?><style>
    .uploadpic {
        float: left;
        width: 295px;
        text-align: center;
        height: 165px;
    }

    .uploadpic h3 {
        text-align: left;
        border: 1px solid #95B8E7;
        float: left;
        padding: 4px;
        background-color: #95B8E7;
        color: #FFF;
    }

    .up-content {
        border: 1px solid #95B8E7;
        padding: 4px;
    }

    .w10 {
        float: left;
        width: 10px;
        color: #FFF;
    }

    .items {
        padding: 10px 0 4px 0;
        border-top: solid 1px #D6D4D4;
        display: block;
    }

    #dd div {
        padding-right: 10px;
        padding-bottom: 10px;
    }

    .addItems {
        float: left;
    }

    /*表格样式  */
    .add_table {
        width: 100%;
        border: 1px solid #0e90d2;
    }

    .add_table th {
        width: 80px;
        background-color: #E0ECFF;
        padding: 8px 0 8px 0;
        border-right: solid 1px #95B8E7;
        border-bottom: solid 1px #95B8E7;
    }

    .add_table td {
        border-bottom: solid 1px #95B8E7;
    }

    .add_table tr {
        border: solid 1px #95B8E7;
    }

    .tb_head {
        text-align: center;
        padding: 10px;
        background-color: #E0ECFF;
        font-size: 20px;
        font-weight: bold;
    }

    .inline {
        display: inline;
        padding-right: 5px;
    }

    .row_container {
        padding: 8px 5px 5px 5px;
    }


    .add_zl_title{
        font-size: 20px;
        color: #0e2d5f;
        text-align: center;
        padding: 10px;
        font-weight: bold;
    }
</style>
<div class="add_zl_title">添加APP数据</div>
    <form id="add_zj_form" action="/solve/index.php/Home/Quality/add_quality" enctype="multipart/form-data" method="post" style="padding:10px;">



        <table class="add_table">
            <tr>
                <th>图号/名称</th>
                <td>
                    <div class="row_container" style="background: #FFFEE6;">

                        <div class="inline">
                            <span class="add_label">图号</span>
                            <input id="th_add" class="easyui-textbox" data-options="required:true"
                                   name="th" style="width:200px;"/>


                        </div>
                        <div class="inline">
                            <span class="add_label">名称</span>
                            <input id="mc_add" class="easyui-textbox" data-options="required:true"
                                   name="mc" style="width:200px;"/>


                        </div>





                    </div>
                </td>
            </tr>
            <th>分类</th>
            <td style="background-color:rgba(204, 204, 204, 0.4);">
                <div class="row_container">

                    <div class="panel" style="display: block;">
                        <div class="easyui-panel panel-body panel-body-noheader" style="padding: 5px; width: 100%;"
                             title="">

                            <span class="add_label">分类：</span>

                            <input id="fl_add" class="easyui-textbox" data-options="required:true,prompt:'请输入标签，用,隔开'"
                                   name="fl" style="width:200px;"/>

                            <span class="add_label" style="padding-left:5px;">类别：</span>
                            <select id="lb_add" class="easyui-combobox" name="lb" style="width:200px;" data-options="editable:false,required:true,panelHeight:'auto'">
                                <option value="支架" selected="selected">支架</option>
                                <option value="管路">管路</option>
                                <option value="塑料件">塑料件</option>
                                <option value="卡箍">卡箍</option>

                            </select>



                            <br>
                        </div>
                    </div>
                </div>



            </td>
            </tr>
            <tr>
                <th>图纸</th>
                <td>
                    <div class="easyui-panel" style="padding:5px;">
                        <input  name="tzs[]" id="tzs"  style="width:80%;"  data-options="multiple:true,buttonText:'上传图纸',buttonIcon:'icon-standard-bullet-picture',buttonAlign:'right',accept:'image/*'"
                                class="easyui-filebox">
                    </div>



                </td>
            </tr>
            <tr>
                <th>上传图片</th>
                <td>
                    <div class="easyui-panel" style="padding:5px;">
                        <input  name="zps[]" id="zps"  style="width:80%;"  data-options="multiple:true,buttonText:'上传照片',buttonIcon:'icon-standard-bullet-picture',buttonAlign:'right',accept:'image/*'"
                                class="easyui-filebox">
                    </div>



                </td>
            </tr>
            <tr>
                <th>说明</th>
                <td>
                    <div class="easyui-panel" style="padding:5px;">
                        <textarea name="description" class="easyui-textbox" id="description" style="width: 100%; height: 46px;"
                                  data-options="required:true"></textarea>

                    </div>



                </td>
            </tr>

        </table>
        <input type="hidden" name="userid" id="userid" value=<?php echo ($_SESSION['uid']); ?>>
        <input type="hidden" name="author" id="author" value=<?php echo ($_SESSION['uname']); ?>>
        <input type="hidden" name="nickname" id="nickname" value=<?php echo ($_SESSION['unickname']); ?>>
    </form>




<div style="background-color: #E0ECFF;
    bottom: 0px;
    position: absolute;
    width: 100%;
    border: 1px solid #95b8e7;">
    <a href="#" class="easyui-linkbutton" onclick='newZj()'
       data-options="iconCls:'icon-standard-page-word',plain:true">新建支架</a>
    <a href="#"  class="easyui-linkbutton" onclick='clearzjForm()'
       data-options="iconCls:'icon-standard-coins-delete',plain:true">清空</a>
    <a href="#"  class="easyui-linkbutton" onclick='back_zj_list()'
       data-options="iconCls:'icon-standard-cup-go',plain:true">返回</a>
</div>
<script>






    function back_zj_list(){
        var tab = $('#tab').tabs('getSelected');
        tab.panel('refresh', APP+'/Home/Zhijia/index');
    }
    function newZj(){
        $('#add_zj_form').form('submit', {

            url :APP+ '/Home/Zhijia/add',
            // onSubmit: function(param){
            //     param.gy = $('#gy').textbox('getText');
            // },

            success : function(data) {
                $('#add_zj_form').form('clear');
                $.messager.confirm('确认',data+'是否要返回列表页面',function(r){
                    if (r){
                        var tab = $('#tab').tabs('getSelected');
                        tab.panel('refresh', APP+'/Home/Zhijia/index');
                    }
                });
            }
        });
    }
function clearzjForm(){
    $.messager.confirm('确认','您确认想要清空记录吗？',function(r){
        if (r){
            $('#add_zj_form').form('clear');
        }
    });
}

    $('#cj_add').combobox({
        valueField: 'id',
        url: APP+'/Admin/Trem/cjList',
        textField: 'title',
        editable: false,
        onSelect: function (rec) {
            $('#gw_add').combogrid({
                panelWidth: 200,
                idField: 'title',
                textField: 'title',
                multiple: true,
                striped: true,
                url: APP+'/Admin/Trem/cjList?pid=' + rec.id,
                columns: [[
                    {field: 'title', title: '名称', width: 120}
                ]]
            });
            $('#gw_add').combobox('clear');
        }
    });





</script>